package com.jie.config;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;

@Component
//InitializingBean是spring启动就执行他的方法
public class OssCaonfig implements InitializingBean {
  //使用value读取配置文件内容

  @Value("${aliyun.oss.file.endpoint}")
  private  String endpoint;
  @Value("${aliyun.oss.file.keyid}")
  private String keyid;
  @Value("${aliyun.oss.file.keysecret}")
  private String keySecret;
  @Value("${aliyun.oss.file.bucketname}")
  private String bucketName;

  public static String ENDPOINT;

  public static String KEYID;

  public static String KEYSECRET;

  public static String BUCKETNAME;
    @Override
    public void afterPropertiesSet() throws Exception {
    ENDPOINT=endpoint;
    KEYID=keyid;
    KEYSECRET=keySecret;
    BUCKETNAME=bucketName;

    }
}
